package com.empire.module.member.controller.admin.user.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

@Schema(description = "管理后台 - 会员用户 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MemberUserRespVO extends MemberUserBaseVO {

    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23788")
    private Long id;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    @Schema(description = "会员标签", example = "[红色, 快乐]")
    private List<String> tagNames;

    @Schema(description = "用户分组", example = "购物达人")
    private String groupName;

    @Schema(description = "人员管控单位", example = "2")
    private Long deptId;

    /**
     * 是否是案件的人员
     */
    private Boolean isCase = false;

    /**
     * 是否是预警条件的人员
     */
    private Boolean isWarnSetting = false;

    /**
     * 是否是预警报告条件的人员
     */
    private Boolean isPresentationSetting = false;

    /**
     * 国家
     */
    @Schema(description = "国家", example = "中国")
    private String country;
    /**
     * 国籍/民族
     */
    @Schema(description = "国籍/民族", example = "汉子")
    private String nation;
    /**
     * 备注
     */
    @Schema(description = "备注", example = "爱说笑唱歌")
    private String remark;
    /**
     * 电话号码
     */
    @Schema(description = "电话号码", example = "18898943452,16489352351")
    private String phoneNumber;
    /**
     * 车牌号码
     */
    @Schema(description = "车牌号码", example = "京A89783,沪A89345")
    private String carNumber;
    /**
     * 护照号
     */
    @Schema(description = "护照号", example = "H4530923")
    private String passportNumber;

    @Schema(description = "会员身份证号码", example = "100101195809133242")
    private String idcard;
    /**
     * 宗教信仰
     */
    @Schema(description = "宗教信仰", example = "基督教")
    private String faith;
    /**
     * 居住地
     */
    @Schema(description = "居住地", example = "广东省xxx1号")
    private String liveAddress;
    /**
     * 户籍地
     */
    @Schema(description = "户籍地", example = "广东省xxx1号")
    private String birthPlace;

    @Schema(description = "最后出现地点", example = "广东省xxx1号")
    private String lastLocation;

    @Schema(description = "最后出现时间", example = "2025-09-09 12:00:09")
    private String lastLocationTime;

    @Schema(description = "频繁出现地址", example = "广东省xxx1号")
    private String frequentAddress;

    @Schema(description = "频繁出现地址出现次数", example = "5")
    private Integer appearanceCount;

    @Schema(description = "是否外国人", example = "1")
    private Integer foreigner;

    /**
     * 是否外国人 1-是 2-不是
     */
    @Schema(description = "证件号码", example = "U3450340")
    private String paperNumber;

    public String getPaperNumber() {
        if (foreigner != null) {
            if (foreigner == 1) {
                paperNumber = passportNumber;
            }
            if (foreigner == 2) {
                paperNumber = idcard;
            }
        }
        return paperNumber;
    }
}
